home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / WINER.ZIP / CHAP6-12.BAS < prev    next >
BASIC Source File  |  1992-05-13  |  713b  |  30 lines

  1. '*********** CHAP6-12.BAS - demonstrates direct access to video memory
  2.  
  3. 'Copyright (c) 1992 Ethan Winer
  4.  
  5. DEFINT A-Z
  6.  
  7. CLS
  8. LOCATE 20, 1
  9. PRINT "Keep pressing a key to continue"
  10.  
  11. DEF SEG = 0
  12. IF PEEK(&H463) = &HB4 THEN
  13.   DEF SEG = &HB000
  14. ELSE
  15.   DEF SEG = &HB800
  16. END IF
  17.  
  18. Test$ = "Hello!"
  19. Colr = 9
  20.  
  21. FOR X = 1 TO LEN(Test$)         'walk through the string
  22.   Char = ASC(MID$(Test$, X, 1)) 'get this character
  23.   POKE Address, Char            'poke to display memory
  24.   WHILE LEN(INKEY$) = 0: WEND   'pause for a keypress
  25.   POKE Address + 1, Colr        'now poke the color
  26.   Address = Address + 2         'bump to the next address
  27.   WHILE LEN(INKEY$) = 0: WEND   'pause for a keypress
  28. NEXT
  29. END
  30.